

<div class="container">

<?php
/*
	$tmpl = array (
		'table_open'          => '<table class="table" border="0" cellpadding="4" cellspacing="0">',

		'heading_row_start'   => '<tr>',
		'heading_row_end'     => '</tr>',
		'heading_cell_start'  => '<th>',
		'heading_cell_end'    => '</th>',

		'row_start'           => '<tr>',
		'row_end'             => '</tr>',
		'cell_start'          => '<td>',
		'cell_end'            => '</td>',

		'row_alt_start'       => '<tr>',
		'row_alt_end'         => '</tr>',
		'cell_alt_start'      => '<td>',
		'cell_alt_end'        => '</td>',

		'table_close'         => '</table>'

	);

	$this->table->set_template($tmpl);

	$this->table->set_heading('Naziv dokumenta', 'Tip dokumenta');

	echo $this->table->generate($records);

	echo '<div id="pagination">'. $this->pagination->create_links() . '</div>'; */


?>

<div>
	<form class="form-files" method="post" action="<?php echo base_url('site/files'); ?>">

		
			<label>Tip dokumenta</label>
			<?php
			
			$options = array();

			$options['sve'] = "Sve";
			foreach ($doc_types_query as $dq) {
				$options[$dq->short_name] = $dq->full_name;
			}
			
			
			echo form_dropdown('doc_type', $options, $doc_type);

			?>

			<label>Partner</label>

			<?php
			
			$options = array();
			$options['sve'] = "Svi partneri";
			foreach ($partners_query as $pq) {
				$options[$pq->partner_short_name] = $pq->partner_full_name;
			}
			
			
			echo form_dropdown('partner', $options, $partner);

			?>


			<label>Poredak</label>

			<?php
			$options=array(
				'asc' => 'Rastuci',
				'desc' => 'Opadajuci'
				);

			 echo form_dropdown('order', $options, $order);
			?>
			
			<button type="submit" class="btn btn-primary">	
			<span class="glyphicon glyphicon-search"></span>
			 Pretraga
			</button>
		
		<div class='input-group date' id='datetimepicker2'>
			
			<input id="date2" type='date' name='created_from' class="form-control" value="<?php echo $created_from; ?>" />
			<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
			</span>
			<input id="date3" type='date' name='created_to' class="form-control" value="<?php echo $created_to; ?>" />
			<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
			</span>

		</div>
	
		
	</form>
</div>


<div id="results">
	<table class="table">

		<thead>
			<tr>
				<th>Naziv dokumenta</th>
				<th>Komentar</th>
			</tr>
		</thead>

		<?php foreach ($query as $q): ?>
			<tr>
				<td><a href="<?=base_url('/uploads/'. $q->path )?>" target="_blank"><?php echo $q->path; ?></a></td>
				<td><?php echo $q->comment; ?></td>
				<td>
				  <a href="<?= base_url('site/update/' . $q->id); ?>" class="btn btn-warning btn-xs" onclick="return confirm('Da li ste sigurni?')">
				  <span class="glyphicon glyphicon-pencil"></span> Izmijeni</a>			
				  <a href="<?= base_url('site/delete/' . $q->id); ?>" class="btn btn-danger btn-xs" onclick="return confirm('Da li ste sigurni?')">
				  <span class="glyphicon glyphicon-remove-circle"></span> Obrisi</a>				
				</td>
			</tr>	
		<?php endforeach; ?>

	</table>
</div>



<?php if(isset($records)){
	echo '<div id="pagination" >'. $this->pagination->create_links() . '</div>'; }?>
</div>



<script type="text/javascript">
	
</script>

</body>
</html>